# -*- coding: utf-8 -*-

# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://doc.scrapy.org/en/latest/topics/item-pipeline.html
from datetime import time

from io import StringIO
import urllib

from PIL import Image
from scrapy.pipelines.images import ImagesPipeline


class JianliPipeline(object):

    def process_item(self, item, spider):
        urls = item['url']
        names = item['name']
        for i in range(len(urls)):
            urllib.request.urlretrieve(urls[i], 'E:\\简历\\'+names[i]+'.png')
            print(names[i]+"的简历爬取成功！")
        return item

